package com.jeecg.demo.service.impl;

import com.jeecg.demo.entity.TTlTiaok;
import com.jeecg.demo.entity.VEcpHetslinfoEntity;
import com.jeecg.demo.service.VEcpHetslinfoServiceI;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;

@Service("vEcpHetslinfoService")
@Transactional
public class VEcpHetslinfoServiceImpl
  extends CommonServiceImpl
  implements VEcpHetslinfoServiceI
{
  @Autowired
  private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
  
  public void delete(VEcpHetslinfoEntity entity)
    throws Exception
  {
    super.delete(entity);
  }
  
  public Serializable save(VEcpHetslinfoEntity entity)
    throws Exception
  {
    Serializable t = super.save(entity);
    return t;
  }
  
  public void saveOrUpdate(VEcpHetslinfoEntity entity)
    throws Exception
  {
    super.saveOrUpdate(entity);
  }

  public List<TTlTiaok> findTiaokInfo(String lx) {
    List<TTlTiaok> ret = null;
    String sql = "";

    try {
      sql = " from TTlTiaok  ";
      if (null != lx && !lx.equals("")) {
        sql = sql + " where  tiaoklx='" + lx + "'";
      }
      else {
        sql = sql + " where  paix='0' ";
      }
      sql = sql + " order by sysid ";

      System.out.println(sql);
      ret = super.findByQueryString(sql);
    }
    catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return ret;
  }
}
